{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="file" name="photo" id="photo" value="" placeholder="免冠照片">
<input type="button" onclick="postData();" value="下一步" name="" style="width:100px;height:30px;">

<script src="{% static 'users/bower_components/jquery/dist/jquery.min.js' %}"></script>
<script type="text/javascript">
    function postData() {
        console.log('post');
        var formData = new FormData();
        formData.append("params_file", $("#photo")[0].files[0]);
        formData.append("who", '123');
        $.ajax({
            url: '/data/uploadParamsFiles/', /*接口域名地址*/
            type: 'POST',
            data: formData,
            contentType: false,
            processData: false,
            success: function (res) {
                console.log(res);
            }
        })
    }
</script>
</body>
</html>